package com.guf.restful.service;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.guf.restful.core.BaseResource;

@Path("user")
public class UserService extends BaseResource {

	@Path("/getText")
	@GET
	@Produces(MediaType.TEXT_PLAIN)
	public String getString() {
		return "123";
	}

	@Path("/getJson")
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public String getJson() {
		return "123";
	}

	@Path("/getXml")
	@GET
	@Produces(MediaType.APPLICATION_XHTML_XML)
	public String getXml() {
		return "<text>123</text>";
	}

	@GET
	@Path("/{param}")
	@Produces("text/plain;charset=UTF-8")
	public String sayHelloToUTF8(@PathParam("param") String username) {
		return "Hello " + username;
	}

}
